﻿Public Class _Default
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Request.Params("Tag") = Nothing Or Request.Params("Tag") = "" Then
            ResearchTagDefaultPageDataSource.SelectCommand = "SELECT Top 3 [Title], [ID], [AddedBy], [Rating], [FirstPagePicture] FROM [Researches]"
        Else
            ResearchTagDefaultPageDataSource.SelectCommand = "SELECT DISTINCT [Title], [ID], [AddedBy], [Rating], [FirstPagePicture], [Tag] FROM [ResearchesTagsView] WHERE ([Tag] = ?)"
        End If
        'This is for adding roles for users
        If User.IsInRole("superuser") Then
            ph_statistics.Visible = True
            ph_superUsers.Visible = True
            ph_highlights.Visible = True
        Else
            ph_statistics.Visible = False
            ph_superUsers.Visible = False
            ph_highlights.Visible = False
        End If
    End Sub

End Class